package manong.serviceimpl;


import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import manong.beans.selecourse;
import manong.mapper.selectCourse;
import manong.service.selectCourseService;
@Service @Transactional
public class selectCourseImple implements selectCourseService{
@Resource  selectCourse selectcourse;

	public int add_course(selecourse course) {
		// TODO Auto-generated method stub
		return 0;
	}

	public void update_course(selecourse course) {
		// TODO Auto-generated method stub
		
	}

	
	public int delete_course(int cno) {
		// TODO Auto-generated method stub
		return 0;
	}

	
	public List<selecourse> getAll_course() {
		// TODO Auto-generated method stub
		return selectcourse.getAll_course();
	}

	
	public selecourse get_course(int cno) {
		// TODO Auto-generated method stub
		return null;
	}
	/*
	 * public PageInfo<selecourse> getAll_course(int pageNum, int pageSize) {
	 * PageHelper.startPage(pageNum, pageSize); List<selecourse> courselist =
	 * selectcourse.getAll_course(); PageInfo<selecourse> pageInfo = new
	 * PageInfo<>(courselist); System.out.println("获取当前页："+pageInfo.getPageNum());
	 * System.out.println("获取每一页的页数"+pageInfo.getPageSize());
	 * System.out.println("获取当总页数："+pageInfo.getPages());
	 * System.out.println("获取总记录数"+pageInfo.getTotal());
	 * System.out.println("获取第一页"+pageInfo.getNavigateFirstPage());
	 * System.out.println("获取最后一页"+pageInfo.getNavigateLastPage());
	 * System.out.println("获取上一页"+pageInfo.getPrePage());
	 * System.out.println("获取下一页"+pageInfo.getNextPage());
	 * System.out.println("获取当前页数据"+pageInfo.getList().size()); return pageInfo; }
	 */

	
	public List<selecourse> getAllCourse(Integer pageNum, Integer pageSize) {
		
		 PageHelper.startPage(pageNum, pageSize);
		return selectcourse.getAllCourse(pageNum, pageSize);
	}






}
